package com.wcarmon.life.command{

    import com.adobe.cairngorm.commands.ICommand
    import com.adobe.cairngorm.control.CairngormEvent;
	import mx.controls.Alert;
	import mx.rpc.events.ResultEvent;
	import mx.rpc.events.FaultEvent;
	import mx.rpc.IResponder;
	import com.wcarmon.life.model.LifeModelLocator;
	//import com.wcarmon.life.event.
	import com.wcarmon.life.business.GetIdleProjectsDelegate;
	import com.wcarmon.life.vo.BlockVO;
	import mx.utils.ObjectUtil;


	
	public class ShowIdleProjectsCommand implements ICommand, IResponder {
		include "../../includes/loggerSnippet.as";
	
		public function execute( event : CairngormEvent ) : void { 
			( new GetIdleProjectsDelegate(this) ).getIdleProjects();
		}
	
	 	public function result( event : Object ) : void {
			var e : ResultEvent = ResultEvent(event);
			var model : LifeModelLocator = LifeModelLocator.getInstance();
			log.debug("Idle Projects:\n" + ObjectUtil.toString(e.result) );
			//Givon: Check if e.result is empty
			Alert.show("implement idle projects ... see log for results from server");
		}
	
		public function fault( event : Object ) : void {
			include "includes/FaultSnippet.as";
		}
	}
}